<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <!-- v-for="i in 4" -->
      <!-- 注意：v-for指令vue官方不建议使用v-if指令 -->
      <div v-for="i in 4" :key="i">第{{i}}个div</div>
      <hr>
      <!-- v-for="item in list" -->
      <div v-for="item in list" :key="item.id">名字：{{item.name}}</div>
      <hr>
      <!--  v-for="(item,i) in list" -->
      <div v-for="(item,i) in list" :key="i">名字：{{item.name}} 索引{{i}}</div>
      <!--  v-for="(v,k,i) in obj" -->
      <div v-for="(v,k,i) in obj" :key="k">值：{{v}} 键：{{k}} 索引：{{i}}</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: '#app',
        data: {
          // 数组
          list: [{id:1,name:'tom',age:10},{id:2,name:'tony',age:12}],
          // 对象
          obj: {
            name: 'tom',
            age: 10
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>